
package com.ebuy.mall.dao;

import com.ebuy.mall.entity.EBuyMallGoods;
import com.ebuy.mall.entity.StockNumDTO;
import com.ebuy.mall.util.PageQueryUtil;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EBuyMallGoodsMapper {
    int deleteByPrimaryKey(Long goodsId);

    int insert(EBuyMallGoods record);

    int insertSelective(EBuyMallGoods record);

    EBuyMallGoods selectByPrimaryKey(Long goodsId);

    EBuyMallGoods selectByCategoryIdAndName(@Param("goodsName") String goodsName, @Param("goodsCategoryId") Long goodsCategoryId);

    int updateByPrimaryKeySelective(EBuyMallGoods record);

    int updateByPrimaryKeyWithBLOBs(EBuyMallGoods record);

    int updateByPrimaryKey(EBuyMallGoods record);

    List<EBuyMallGoods> findNewBeeMallGoodsList(PageQueryUtil pageUtil);

    int getTotalNewBeeMallGoods(PageQueryUtil pageUtil);

    List<EBuyMallGoods> selectByPrimaryKeys(List<Long> goodsIds);

    List<EBuyMallGoods> findNewBeeMallGoodsListBySearch(PageQueryUtil pageUtil);

    int getTotalNewBeeMallGoodsBySearch(PageQueryUtil pageUtil);

    int batchInsert(@Param("newBeeMallGoodsList") List<EBuyMallGoods> EBuyMallGoodsList);

    int updateStockNum(@Param("stockNumDTOS") List<StockNumDTO> stockNumDTOS);

    int batchUpdateSellStatus(@Param("orderIds")Long[] orderIds,@Param("sellStatus") int sellStatus);

    boolean addStock(Long goodsId, Integer goodsCount);
}
